#include<iostream>
using namespace std;
const int N = 110;
int n, k, x;
int main()
{
	int t;
	cin >> t;
	while (t--) {
		cin >> n >> k >> x;
		if (n & 1) {
			if(x == 1){
				if (k < 3) {
					cout << "NO" << endl;
					continue;
				}
				else {
					cout << "YES" << endl;
					cout << 1 + (n - 3) / 2 << endl;
					cout << "3" << " ";
					for (int i = 0; i < (n - 3) / 2; i++) {
						cout << 2 << " ";
					}
					cout << endl;
				}
			}
			else {
				cout << "YES" << endl;
				cout << n << endl;
				for (int i = 0; i < n; i++) {
					cout << 1 << " ";
				}
				cout << endl;
			}
		}
		else {
			/*if (x == 1) {
				cout << "NO" << endl;
				continue;
			}
			else {
				cout << "YES" << endl;
				cout << n << endl;
				for (int i = 0; i < n; i++) {
					cout << 1 << " ";
				}
				cout << endl;
			}*/
			if (k == 1) {
				cout << "NO" << endl;
				continue;
			}
			if (x == 2) {
				cout << "YES" << endl;
				cout << n << endl;
				for (int i = 0; i < n; i++) {
					cout << 1 << " ";
				}
				cout << endl;
			}
			else {
				cout << "YES" << endl;
				cout << n / 2<< endl;
				for (int i = 0; i < n / 2; i++) {
					cout << 2 << " ";
				}
				cout << endl;
			}
		}
	}
	return 0;
}